package com.demo.springdatajpademo.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

@Data //getter setter hashcode equle tostring
@Entity
@AllArgsConstructor //有参的构造函数
@NoArgsConstructor//无参的构造函数
@Builder//构建者
public class Person {
    @Id
    @GenericGenerator(name = "myuuid",strategy = "uuid")
    @GeneratedValue(generator = "myuuid")
    private String pid;
    @Column(unique = true)
    private String pname;
    private String psex;
    private Integer page;
    private boolean getmarried;

}
